<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>测试页</title>
	<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
	<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.js"></script>
	<script src="https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.js"></script>
	<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.css" rel="stylesheet">
	
	<script src="https://www.layuicdn.com/layui-v2.5.6/layui.js"></script>
	<link href="https://www.layuicdn.com/layui-v2.5.6/css/layui.css" rel="stylesheet">
	<style type="text/css">
		.all,.main_div{
			padding: 1px 15px 1px 10px;
		}
		.div_header{
			text-align: center;
			font-weight: bold;
			font-size: 16px;
			border-bottom: 1px solid;
			padding-bottom: 10px;
			padding-top: 10px;
		}
		a {
    		color: blue;
    		text-decoration: underline;
    		cursor: pointer;
		}
		
	</style>
</head>
<body>

<button type="button" class="btn btn-primary " onclick="querySpPersonList();">querySpPersonList</button>
<button type="button" class="btn btn-primary " onclick="querySpPersonTree();">querySpPersonTree</button>
<button type="button" class="btn btn-primary " onclick="addSpPerson();">addSpPerson</button>
<button type="button" class="btn btn-primary " onclick="updateSpPerson();">updateSpPerson</button>
<button type="button" class="btn btn-primary " onclick="delSpPerson();">delSpPerson</button>
<button type="button" class="btn btn-primary " onclick="updateSpPersonIdx();">updateSpPersonIdx</button>
<br />
<div id="console">console</div>

</body>
<script type="text/javascript">
	function querySpPersonList(){
		jQuery.ajax({
			url: '[[@{/}]]rest/mat/baseManager/querySpPersonList',
			async: true,
			//dataType: 'json',
			contentType: "application/json",
			type: 'get',
			//data: JSON.stringify(jQuery.extend({}, self._data)),//self.addParam,
			success: function(res){
				jQuery("#console").html(JSON.stringify(res));
			}
		});
	}
	
	function querySpPersonTree(){
		jQuery.ajax({
			url: '[[@{/}]]rest/mat/baseManager/querySpPersonTree',
			async: true,
			//dataType: 'json',
			contentType: "application/json",
			type: 'get',
			//data: JSON.stringify(jQuery.extend({}, self._data)),//self.addParam,
			success: function(res){
				jQuery("#console").html(JSON.stringify(res));
			}
		});
	}
	
	function addSpPerson(){
		jQuery.ajax({
			url: '[[@{/}]]rest/mat/baseManager/addSpPerson',
			async: true,
			//dataType: 'json',
			contentType: "application/json",
			type: 'post',
			data: JSON.stringify({
				person_id: '11;21',
				person_name: '12;22',
				person_dept: '13;23',
				person_dept_name: '14;24',
				sp_level: '15;25'
			}),//self.addParam,
			success: function(res){
				jQuery("#console").html(JSON.stringify(res));
			}
		});
	}
	
	function updateSpPerson(){
		jQuery.ajax({
			url: '[[@{/}]]rest/mat/baseManager/updateSpPerson',
			async: true,
			//dataType: 'json',
			contentType: "application/json",
			type: 'post',
			data: JSON.stringify({
				id: 1,
				person_id: 'aaa',
				person_name: '11',
				person_dept: '22',
				person_dept_name: '33',
				sp_level: '4'
			}),//self.addParam,
			success: function(res){
				jQuery("#console").html(JSON.stringify(res));
			}
		});
	}
	
	function delSpPerson(){
		jQuery.ajax({
			url: '[[@{/}]]rest/mat/baseManager/delSpPerson',
			async: true,
			//dataType: 'json',
			contentType: "application/json",
			type: 'post',
			data: JSON.stringify({
				id: 1
			}),//self.addParam,
			success: function(res){
				jQuery("#console").html(JSON.stringify(res));
			}
		});
	}
	
	function updateSpPersonIdx(){
		jQuery.ajax({
			url: '[[@{/}]]rest/mat/baseManager/updateSpPersonIdx',
			async: true,
			//dataType: 'json',
			contentType: "application/json",
			type: 'post',
			data: JSON.stringify({
				qian_id: 2,
				hou_id: 3,
				qian_sp_level: 111,
				hou_sp_level: 222
			}),//self.addParam,
			success: function(res){
				jQuery("#console").html(JSON.stringify(res));
			}
		});
	}
</script>
</html>